<template>
    <div>
        <ul class="menu_top_list ">
            <li @click="add()">
                <span class="iconfont icon-fanhui"></span>

            </li>
            <li></li>
            <li></li>

        </ul>
        <div class="margin22">
            <div v-show="qwe">
                <div class="edit-btn" id="edit-btn" v-show="bbq" @click="bbq = !bbq">编辑</div>
                <div class="edit-task" style="" v-show="!bbq">
                    <span id="play-remove" @click="delss">清空合辑</span>
                    <span id="play-remove" @click="bdd">清空游戏</span>

                    <span id="play-finish" @click="bbq = !bbq">完成</span>
                </div>
            </div>

            <van-tabs class="cf" v-model="active">
                <div @click="abc()">
                    <van-tab title="游戏">
                        <div class="md-list">
                            <div id="list_box">

                                <ul>
                                    <van-cell class="list-div" v-for=" (k, index) in  this.con " :key="'i-fo-' + index">
                                        <li>
                                            <router-link :to="'./GameDetails?id=' + k.id">


                                                <img :src="k.pic"><em>{{ k.title }}</em>

                                                <p>{{ k.html5introduce }}</p><span>{{ k.category }} | 人气:{{
                                                        k.wapclicks
                                                }}</span><i class="icon-"></i>
                                            </router-link>
                                            <router-link :to="'/start?id=' + k.id" tag="a" class="btn" v-show="bbq">开始玩
                                            </router-link>
                                            <a class="del-btn" v-show="!bbq" @click="acfun(index)">删除</a>
                                        </li>
                                    </van-cell>
                                </ul>


                            </div>
                        </div>

                    </van-tab>
                </div>

                <div @click="edg()">
                    <van-tab title="合辑">
                        <div class="md-collect">
                            <ul id="list_box">
                                <li v-for="(item, index) in this.obj " :key="'ifo-' + index">
                                    <router-link tag="a" :to="'./gameCo?id=' + item.id">
                                        <img :src="item.img" alt="">
                                        <p>{{ item.title }}</p><span>{{ item.qq }}</span>
                                    </router-link>

                                </li>

                            </ul>

                        </div>
                    </van-tab>
                </div>


            </van-tabs>
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            con: null,
            obj: [],
            list: [],
            rbq: null,
            bbc: null,
            loading: false,
            finished: false,
            count: 1,
            scrollTop: "",//距离顶部的距离
            scrollHeight: "",//总共的高
            offsetHeight: "",//当前页面的高.
            active: 0,
            bbq: true,
            qwe: true

        }
    },
    methods: {
        delss() {
            this.$store.commit("likedel")
        },
        edg() {
            this.qwe = false
            console.log(this.qwe);
        },
        abc() {
            this.qwe = true

            console.log(this.qwe);


        },
        acfun(index) {
            this.$store.commit("collectFundel", index)

        },
        bdd() {
            this.$store.commit("collectdel")
        },
        // 返回go(-1)
        add() {
            this.$router.go(-1)
        },
    },
    created() {
        this.con = this.$store.state.collect
        this.obj = this.$store.state.like

    },

}
</script>
<style lang="scss" scoped>
.loadmore p span {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -60px;
    display: block;
    width: 120px;
    background: #fff;
}

.loadmore p::before {
    display: block;
    position: absolute;
    top: 16px;
    left: 50%;
    width: 250px;
    margin-left: -125px;
    height: 1px;
    background-image: linear-gradient(to right, #f1f1f1 0%, #d7d7d7 50%, #f1f1f1 100%);
    content: "";
}

.loadmore p {
    text-align: center;
    color: #959595;
    font-size: 14px;
    position: relative;
    height: 32px;
}

.loadmore {
    height: 32px;
    line-height: 32px;
    background: #fff;
    text-align: center;
}

.loadmore {
    height: 32px;
    line-height: 32px;
    text-align: center;
    margin: 20px 0;
    color: #b4b3b3;
}

.md-collect li a::after {
    content: '';
    width: 100%;
    height: 105px;
    position: absolute;
    left: 0;
    bottom: 0;
    background: url("https://h.4399.com/images/2022/dark_mask.png") repeat-x;
    background-size: 50px 200px;
}

.md-collect li span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    color: #f1f1f1;
    background: url("https://h.4399.com/images/2022/eyes_icon_2.png") no-repeat left center;
    background-size: 17px 11px;
    padding-left: 19px;
    z-index: 2;
    opacity: 0.8;
}

.md-collect li p {
    width: 70%;
}

.md-collect li p {
    padding: 9px 12px;
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
    position: absolute;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
}

.md-collect li img {
    width: 100%;
    height: 170px;
    display: block;
}

.md-collect li a {
    display: block;
    width: 100%;
    height: 170px;
}

.md-collect li {
    margin: 0 auto 11px;
    width: 100%;
    height: 170px;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

.md-collect {
    margin: 48px 10px;
}

.del-btn {
    border-color: #ff0000;
    color: #ff0000;

}

.md-list li .del-btn {
    position: absolute;
    top: 18px;
    right: 0;
    width: 63px;
    height: 12px;
    line-height: 12px;
    padding: 8px 0;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #ff0000;
    color: #ff0000;
    z-index: 2;
}


.edit-btn {
    color: #3d94ee;
    font-size: 15px;
    position: absolute;
    right: 10px;
    top: 10px;
    height: 48px;
    user-select: none;
    font-size: 15px;
}

.edit-task span {
    float: left;
    margin-left: 21px;
    user-select: none;
}

.edit-task {
    position: absolute;
    right: 10px;
    top: 10px;
    height: 48px;
    color: #959595;
    font-size: 15px;
}

.md-list li span {
    height: 18px;
    line-height: 18px;
    color: #959595;
    font-size: 11px;
}

.md-list li p {
    height: 16px;
    line-height: 16px;
    padding-right: 75px;
    color: #959595;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-list li .btn {
    position: absolute;
    top: 13.5px;
    right: 0;
    width: 64px;
    height: 12px;
    line-height: 12px;
    padding: 8px 0;
    text-align: center;
    border-radius: 5px;
    border: 1px solid #00cc7d;
    color: #00cc7d;
}

.md-list li em,
.md-list li span,
.md-list li p {
    display: block;
    margin-left: 65px;
}

.md-list li em {
    display: inline-block;
    margin-left: 10px;
    height: 18px;
    line-height: 18px;
    font-size: 14px;
    padding-right: 75px;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



em,
i {
    font-style: normal;
    vertical-align: top;
}

.md-list li {
    position: relative;
    margin: 3px 0 15px;
    background: #fff;
    height: 55px;

    margin-bottom: 17px;
}

.list-head {
    padding: 5px 10px;
    margin-bottom: 0;
    background-color: #f5f5f5 !important;
    margin-bottom: 15px;
    height: 19px;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;

}

.md-list li a:first-child {
    height: 55px;
}

.md-list li a {
    display: block;
    position: relative;
}

.md-list li img {
    float: left;
    width: 55px;
    height: 55px;
    border-radius: 12px;
}

.fixed {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
}

.loadmore p span {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -60px;
    display: block;
    width: 120px;
    background: #fff;
}

.loadmore p::before {
    display: block;
    position: absolute;
    top: 16px;
    left: 50%;
    width: 250px;
    margin-left: -125px;
    height: 1px;
    background-image: linear-gradient(to right, #f1f1f1 0%, #d7d7d7 50%, #f1f1f1 100%);
    content: "";
}

.loadmore p {
    text-align: center;
    color: #959595;
    font-size: 14px;
    position: relative;
    height: 32px;
}

.loadmore {
    height: 32px;
    line-height: 32px;
    background: #fff;
    text-align: center;
}

.loadmore {
    height: 32px;
    line-height: 32px;
    text-align: center;
    margin: 20px 0;
    color: #b4b3b3;
}

.margin22 {
    margin-top: 48px;
}

.menu_top_list {
    max-width: 500px;
    margin: 0 auto;

    height: 48px;
    width: 100%;
    background-color: white;
    color: #333;
    font-size: 16px;
    font-weight: bold;

    z-index: 90;
    top: 0;

}

.menu_top_list li+li {
    width: 64%;
    -webkit-box-pack: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.menu_top_list li {
    float: left;
    display: -webkit-box;
    -webkit-box-align: center;
    height: 48px;
}

.menu_top_list li:first-child {
    cursor: pointer;
    width: 18%;
    color: #BFBFBF;
    font-size: 20px
}

.menu_top_list li:last-child {
    width: 18%;
}

.menu_top_list li:first-child::before {
    background: url("https://rs.sfacg.com/web/m/images/menu_top_icon.png") no-repeat -49.216px 9.96px;
    background-size: 105.462px;
    content: "";
    height: 46.8px;
    width: 24.608px;
    display: block;
}
</style>